//
//  CLSpeedAndOilLossCurveController.m
//  ZhuKuang
//
//  Created by jjkj on 17/7/12.
//  Copyright © 2017年 jjkj. All rights reserved.
//

#import "CLSpeedAndOilLossCurveController.h"
#import "CLCurveTitleView.h"
#import "CustomChooseBoxView.h"

@interface CLSpeedAndOilLossCurveController ()

@property (nonatomic,strong) CLCurveTitleView *curveTitleView;

@property (nonatomic,strong) UIView *chartView;

@property (nonatomic,strong) CustomChooseBoxView *chooseView;

@end

@implementation CLSpeedAndOilLossCurveController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:self.curveTitleView];
    [self.view addSubview:self.chartView];
    [self setUpChooseView];
    // Do any additional setup after loading the view.
}

- (CLCurveTitleView *)curveTitleView {
    
    if (!_curveTitleView) {
        _curveTitleView = [[NSBundle mainBundle] loadNibNamed:@"CLCurveTitleView" owner:self options:nil].firstObject;
        _curveTitleView.frame = CGRectMake(0, 32, kScreenWidth, 50);

    }
    return _curveTitleView;
}

- (void)setUpChooseView {

     self.curveTitleView.chooseBoxViewBg.dataArray = [NSMutableArray arrayWithArray:@[@"速度曲线",@"油耗曲线"]];
     [self.curveTitleView.chooseBoxViewBg changeChooseBoxTitle:@"速度曲线"];
}
-(UIView *)chartView {
    if (!_chartView) {
        _chartView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.curveTitleView.frame), kScreenWidth,kScreenHeight - CGRectGetMaxY(self.curveTitleView.frame))];
        _chartView.backgroundColor = [UIColor cyanColor];
    }
    return _chartView;
}

//强制横屏
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}

-(BOOL)shouldAutorotate {
    return YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
@end
